package com.guchenbo.nacos.spring.boot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class NacosApplicationRunner implements ApplicationRunner {

    @Value(value = "${config.key}")
    private String configKey;
    @Value(value = "${override.key}")
    private String overrideKey;
    @Value(value = "${not.nacos.key}")
    private String notNacosKey;
    @Value("${extension1.key:default}")
    private String extension1Key;
    @Value("${extension2.key:default}")
    private String extension2Key;
    @Value("${share1.key:default}")
    private String share1Key;
    @Value("${share2.key:default}")
    private String share2Key;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("configKey: {}, overrideKey: {}, notNacosKey: {}", configKey, overrideKey, notNacosKey);
        log.info("configKey: {}, extension1Key: {}, extension2Key: {}, share1Key: {}, share2Key: {}", configKey,
                        extension1Key, extension2Key, share1Key, share2Key);
    }
}
